Skip to content

Commit

Permalink
Merge branch 'main' into kush/node-runners
Browse files Browse the repository at this point in the history
  • Loading branch information
kush-alloralabs authored Jul 8, 2024
2 parents 59cfd65 + 99f18ad commit 312dfad
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 33 deletions.
2 changes: 1 addition & 1 deletion pages/datasci/build-and-deploy-worker-from-scratch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ CMD ["allora-node", "--role=worker", \
"--private-key=/data/keys/priv.bin", \
"--log-level=debug", \
"--port=9011", \
"--topic=1", \
"--topic=allora-topic-1-worker", \
"--boot-nodes=/ip4/{head-ip}/tcp/{head-port}/p2p/{head-id}"]


Expand Down
4 changes: 2 additions & 2 deletions pages/datasci/deploy-worker-with-allocmd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Using `pipx`:
pipx install allocmd
```

At the time of writing, the latest `allocmd` version is `2.0.3`:
At the time of writing, the latest `allocmd` version is `2.0.5`:
```shell
allocmd --version
allocmd version 2.0.3
allocmd version 2.0.5
```

> You can run `allocmd --help` to get general help or `allocmd [command] --help` to get help relating to a particular command.
Expand Down
2 changes: 1 addition & 1 deletion pages/datasci/register-worker-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ allora-node \
--log-level=debug \
--port=9010 \
--boot-nodes=/dns4/heads.testnet.allora.network/tcp/9527/p2p/12D3KooWH9GerdSEroL2nqjpd2GuE5dwmqNi7uHX7FoywBdKcP4q \
--topic=1 \
--topic=allora-topic-1-worker \
--allora-chain-home-dir=/data/.allorad \
--allora-node-rpc-address=https://some-allora-rpc-address \
--allora-chain-key-name=mNodeKey \
Expand Down
4 changes: 2 additions & 2 deletions pages/datasci/walkthrough-hugging-face-worker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Using `pipx`:
pipx install allocmd
```

At the time of writing, the latest `allocmd` version is `2.0.3`:
At the time of writing, the latest `allocmd` version is `2.0.5`:
```bash
allocmd --version
allocmd version 2.0.3
allocmd version 2.0.5
```

## Initializing the worker for development
Expand Down
2 changes: 1 addition & 1 deletion pages/devs/existing-consumers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

You can find the deployed consumer contracts by looking at the latest saved deployments in the repository:
- [Sepolia](https://sepolia.etherscan.io/address/0x8E45fbef38DaC54e32AfB27AC8cBab30E6818ce6#code)
- [Arbitrum One](https://arbiscan.io/address/0x6032f0862A2c36D0390c348EeCc2ACcDccDa785a#code)
- [Arbitrum One](https://arbiscan.io/address/0xd75A47C0e5Eb0CeDF57072268F48ba971d2cD7F3#code)

## Deploying to additional chains

Expand Down
63 changes: 37 additions & 26 deletions pages/devs/walkthrough-use-topic-inference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,53 @@ curl -X 'GET' --url 'https://api.upshot.xyz/v2/allora/consumer/<chainId>?allora_
Here is an example response:
```json
{
"request_id": "409de397-99f8-4911-91ed-74e6fe748115",
"status": true,
"data": {
"signature": "0x8165fff89ca07fadff3f4e27b200bd3eae2132055aa8f0a224832446505c0662033b3038c9694000af60d4e9fbf8504cd9729b9841db286f45070a9c92f2531d1c",
"inference_data": {
"network_inference": "61022689135670660000000",
"confidence_interval_percentiles": [],
"confidence_interval_values": [],
"topic_id": "11",
"timestamp": 1719688595,
"extra_data": "0x"
}
}
"request_id": "b52b7c20-57ae-4852-bdbb-8f39cf317974",
"status": true,
"data": {
"signature": "0x99b8b75f875a9ecc09fc499073656407458d464edeceb384686dba990ed785d841e6510b578d253a6e19a20503d1ec1e3c38b4c60980ff3b4df9ce3335ebd3851b",
"inference_data": {
"network_inference": "3365485208027959000000",
"confidence_interval_percentiles": ["2280000000000000000", "15870000000000000000", "50000000000000000000", "84130000000000000000", "97720000000000000000"],
"confidence_interval_values": ["2280000000000000000", "15870000000000000000", "50000000000000000000", "84130000000000000000", "97720000000000000000"],
"topic_id": "9",
"timestamp": "1719866777",
"extra_data": "0x"
}
}
}
```


3. Construct a call to the Allora Consumer contract on the chain of your choice (options listed under [deployments](./existing-consumers)) using the returned `signature` and `network-inference` as follows:

## Creating the Transaction:

Note you be doing something more like `callProtocolFunctionWithAlloraTopicInference` in the example above, so you would want to construct your call to that contract in a similar way to the following:
Note you be doing something more like `callProtocolFunctionWithAlloraTopicInference` in the example above, so you would want to construct your call to that contract in a similar way to the following. You can find the complete example [here](https://github.com/allora-network/allora-consumer/blob/main/script/verifyDataExampleSimple.ts).

```typescript
await alloraConsumer.verifyNetworkInference({
signature: signature,
networkInference: {
networkInference: networkInference,
confidenceIntervalPercentiles: confidenceIntervalPercentiles,
confidenceIntervalValues: confidenceIntervalValues,
timestamp: timestamp,
topicId: topicId,
extraData: '0x'
},
extraData: '0x'
const alloraConsumer =
(new AlloraConsumer__factory())
.attach(ALLORA_CONSUMER_ADDRESS)
.connect(senderWallet) as AlloraConsumer

const tx = await alloraConsumer.verifyNetworkInference({
signature: '0x99b8b75f875a9ecc09fc499073656407458d464edeceb384686dba990ed785d841e6510b578d253a6e19a20503d1ec1e3c38b4c60980ff3b4df9ce3335ebd3851b',
networkInference: {
topicId: 9,
timestamp: 1719866777,
extraData: ethers.toUtf8Bytes(''),
networkInference: '3365485208027959000000',
confidenceIntervalPercentiles:['2280000000000000000', '15870000000000000000', '50000000000000000000', '84130000000000000000', '97720000000000000000' ],
confidenceIntervalValues:[ '3016256807053656000000', '3029849059956295000000', '3049738780726754000000', '3148682039955208400000', '3278333171848616500000' ],
},
extraData: ethers.toUtf8Bytes(''),
})

console.info('tx hash:', tx.hash)
console.info('Awaiting tx confirmation...')

const result = await tx.wait()

console.info('tx receipt:', result)
```


Expand Down

0 comments on commit 312dfad

Please sign in to comment.