Chainlink Node Operation on the Polygon Mainnet - chainlink

Doing my research on Chainlink node operation and getting ready to spin up a node, I see the docs, or at least the ones I found, show setting up for eth but I was curious about setting up and maintaining a node for the Polygon mainnet

Follow Running a Chainlink Node step by step tutorial and then adjust parameters for Polygon mainnet like this
echo "ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=137
MIN_OUTGOING_CONFIRMATIONS=2
LINK_CONTRACT_ADDRESS=0xb0897686c545045afc77cf20ec7a532e3120e0f1
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
GAS_UPDATER_ENABLED=true
ALLOW_ORIGINS=*" > ~/.chainlink-polygon/.env
To adjust variables for other chains in the future visit Developer Reference Page

Related

Anylogic: How to move transporter using Trip (travel) time?

I would like to use transporters in my model. The paths in the model are not to scale. How can I move the transporter between the nodes based on travel time?
For example, the same transporter has to be moved between nodes A and B and should do the movement in x mins but if it has to move from node C to node D, it should take y mins. This calls for dynamically updating the speed of the transporter (In the Move By Transporter" block). I am trying to duplicate the "Movement is Defined by: Trip time" functionality found in the "MoveTo" block to the "MoveByTransporter" block. Image: "MoveTo" block functionality that I am trying to add. How do I achieve this?
The reason I need to do this is because exact locations to scale are not known at the moment however, I know how much time it should take for every movement.
I was trying to use length of paths connecting the nodes to define the distance between the nodes. Then dividing this by the time I want it to take to traverse this distance to arrive at a speed and then feeding this speed to the transporter. However, since this distance will change, this approach is not viable.
In my opinion, your approach is exactly right Just make it dynamic.
Use the distance function belonging to the RoutData API
and measure the distance of the path that the transporter will take using the findShortestPath function of the TransporterFleet object.
Good luck!

TDMA and FDMA based slot assignment protocol in OMNeT++

I need to implement TDMA and FDMA based slot assignment protocol. I have written the code for TDMA slot assignment but very much confused about the FDMA part.
Will someone please help me in writing the code for FDMA for a simple scenario. In which two nodes are using full duplex radios and working on two different frequencies. If node1 needs to communicate to node 2 thn node 2 must shift its frequency to node 1 frequency.
I have not worked with the radios yet. In TDMA part i am using senddirect for sending messages.
Kindly help me with the code of FDMA?
You have to use multiple radios in a single host. A good starting point is the example in inet path examples/manetrouting/multiradio. Run the simulation configuration MultiRadio within omnetpp.ini.

ns2 projects in wireless networks

how to construct tree in ns2 and how to write routing protocol in ns2?
clustered nodes to be arranged in tree structure and code for deflection routing in ns2.
I also need to know how to increase the energy of a node and how to make a node inactive.
For simulating the energy of nodes the example in tcl/ex/wireless-newnode-energy.tcl
Also, to see the available command for changing the energy of a node during simulation, see see source files in mac/wireless-phy.cc, method int WirelessPhy::command(int argc, const char*const* argv)
To implement your own routing protocol in ns2, read this article
I did not fully understand the part about the tree structure and the deflection.

How to make sense of Phase 2 in Paxos distributed consensus algorithm?

I have pasted pseudocode for a paxos algorithm here:
What is a "view" in the Paxos consensus algorithm?
and was wondering if someone could point me in the right direction.
The algorithm says that each node has a "state" which contains a bunch of information the node should keep track of.
Suppose we have two nodes: Node #1 and Node #2. In the simplest case Node #2 joins Node #1 and they both play paxos. What exactly happens to the states of Node #1 and Node #2 after 2 joins 1? When does the "views" data structure change and what does it contain? If someone can explain to me this simple case of two nodes playing paxos, then I think I can figure out multiple node case.
My current understanding (which I'm pretty sure is not correct) is as follows:
Node #2 sends a message to join Node #1.
Node #1 receives message from Node #2 asking to join.
Node #1 assumes leadership and kicks into phase 1, computes my_num = max(0,0) + 1 = 1
Node #1 sends all nodes in views[0] (which is empty) prepare(1,1)
Node #1 sends initial contact node (Node #2) prepare(1,1)
Node #1 sends Node #1 (itself) prepare(1,1)
Node #2 receives prepare(1,1). It sets its num_h=1 and returns to leader PROMISE(0,{empty list})
Node #1 receives prepare(1,1) and sets its num_h=1 and returns itself PROMISE(0,{empty list}).
now we get to phase 2
This is where I am quite confused.
Node #1 is the leader and it receives two PROMISE(0,{empty list}) messages. According to the algorithm, if the leader gets a majority of promises in views[0] then it can set a value for "v" and send the ACCEPT message to all responders.
What I am confused about is currently the views[0] for the leader is empty so how can you compute the majority of an empty list?
Also, let's assume the leader has received a majority of promises and proceeds to set v = set of pingable nodes (including self). What exactly are pingable nodes? Is it just Node #1 and Node #2?
Would appreciate all / any help and will definitely award points to those that help.
The pseudocode is not specialized for a particular problem. In fact, the professor said we don't need to use pseudocode if we don't want to and said we can look at other Paxos papers (i.e. paxos made simple, paxos made live,etc..) for guidance on implementing this algorithm. Maybe you are right, I should probably look at Wikipedia to implement this algorithm. So the views[..] is simply a hash map of and a node can choose any value it wishes to. If I understand you correctly, you say the majority statement just checks if it received "enough" PROMISE messages. But the only way to know if we have enough is if the node keeps track of who its group members are. Which means that I need a different data structure for this.
Also, I cannot award points to you because you made a comment. If you post an answer then I can give you points.

Need some help understanding this problem about maximizing graph connectivity

I was wondering if someone could help me understand this problem. I prepared a small diagram because it is much easier to explain it visually.
alt text http://img179.imageshack.us/img179/4315/pon.jpg
Problem I am trying to solve:
1. Constructing the dependency graph
Given the connectivity of the graph and a metric that determines how well a node depends on the other, order the dependencies. For instance, I could put in a few rules saying that
node 3 depends on node 4
node 2 depends on node 3
node 3 depends on node 5
But because the final rule is not "valuable" (again based on the same metric), I will not add the rule to my system.
2. Execute the request order
Once I built a dependency graph, execute the list in an order that maximizes the final connectivity. I am not sure if this is a really a problem but I somehow have a feeling that there might exist more than one order in which case, it is required to choose the best order.
First and foremost, I am wondering if I constructed the problem correctly and if I should be aware of any corner cases. Secondly, is there a closely related algorithm that I can look at? Currently, I am thinking of something like Feedback Arc Set or the Secretary Problem but I am a little confused at the moment. Any suggestions?
PS: I am a little confused about the problem myself so please don't flame on me for that. If any clarifications are needed, I will try to update the question.
It looks like you are trying to determine an ordering on requests you send to nodes with dependencies (or "partial ordering" for google) between nodes.
If you google "partial order dependency graph", you get a link to here, which should give you enough information to figure out a good solution.
In general, you want to sort the nodes in such a way that nodes come after their dependencies; AKA topological sort.
I'm a bit confused by your ordering constraints vs. the graphs that you picture: nothing matches up. That said, it sounds like you have soft ordering constraints (A should come before B, but doesn't have to) with costs for violating the constraint. An optimal algorithm for scheduling that is NP-hard, but I bet you could get a pretty good schedule using a DFS biased towards large-weight edges, then deleting all the back edges.
If you know in advance the dependencies of each node, you can easily build layers.
It's amusing, but I faced the very same problem when organizing... the compilation of the different modules of my application :)
The idea is simple:
def buildLayers(nodes):
layers = []
n = nodes[:] # copy the list
while not len(n) == 0:
layer = _buildRec(layers, n)
if len(layer) == 0: raise RuntimeError('Cyclic Dependency')
for l in layer: n.remove(l)
layers.append(layer)
return layers
def _buildRec(layers, nodes):
"""Build the next layer by selecting nodes whose dependencies
already appear in `layers`
"""
result = []
for n in nodes:
if n.dependencies in flatten(layers): result.append(n) # not truly python
return result
Then you can pop the layers one at a time, and each time you'll be able to send the request to each of the nodes of this layer in parallel.
If you keep a set of the already selected nodes and the dependencies are also represented as a set the check is more efficient. Other implementations would use event propagations to avoid all those nested loops...
Notice in the worst case you have O(n3), but I only had some thirty components and there are not THAT related :p

Resources