Code Monkey home page Code Monkey logo

paloma's Introduction

Paloma

A Golang implementation of Paloma Chain, a decentralized, automation network for smart contracts deployed in the Cosmos, EVM, Solana, and Polkadot networks.

Paloma is the fastest, secure crosschain communications blockchain. For Crosschain Software engineers who want simultaneous control of multiple, cross-chain-deployed, smart contracts, Paloma is decentralized and consensus-driven message delivery. Paloma is fast state awareness, low cost state computation, and a powerful attestation system. Polama blockchain enables scalable, crosschain, smart contract execution with any data source.

Table of Contents

Talk to us

We have active, helpful communities on Twitter and Telegram.

International Community

Releases

See Release procedure for more information about the release model.

Active Networks

  • Testnet paloma-testnet-16 (May 23, 2024)
  • Mainnet tumbler (April 22, 2024)

Join an active Network

Note

Some have seen errors with GLIBC version differences with the downloaded binaries. This is caused by a difference in the libraries of the host that built the binary and the host running the binary.

If you experience these errors, please pull down the code and build it, rather than downloading the prebuilt binary

Install the correct version of libwasm

The current required version of libwasm is 1.5.2. If you're upgrading from a prior version it is recommended to remove the cache to avoid errors. If you're already have palomad running, you will need to stop it before doing these steps.

wget https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm.x86_64.so
sudo mv libwasmvm.x86_64.so /usr/lib/

rm -r ~/.paloma/data/wasm/cache

To get the latest prebuilt palomad binary

wget -O - https://github.com/palomachain/paloma/releases/download/v1.15.4/paloma_Linux_x86_64.tar.gz  | \
  sudo tar -C /usr/local/bin -xvzf - palomad
sudo chmod +x /usr/local/bin/palomad

To build palomad using latest release

git clone https://github.com/palomachain/paloma.git
cd paloma
git checkout v1.15.4
make build
sudo mv ./build/palomad /usr/local/bin/palomad

If you're upgrading to the most recent version, you will need to stop palomad before copying the new binary into place.

Connecting to an existing network

Download and install the latest release of palomad.

Initialize our configuration. This will populate a ~/.paloma/ directory.

MONIKER="$(hostname)"
palomad init "$MONIKER"

#for testnet
CHAIN_ID="paloma-testnet-16" 
#for mainnet
CHAIN_ID="tumbler" 

Copy the configs of the network we wish to connect to

Testnet:

wget -O ~/.paloma/config/genesis.json https://raw.githubusercontent.com/palomachain/testnet/master/paloma-testnet-16/genesis.json
wget -O ~/.paloma/config/addrbook.json https://raw.githubusercontent.com/palomachain/testnet/master/paloma-testnet-16/addrbook.json

Mainnet:

wget -O ~/.paloma/config/genesis.json https://raw.githubusercontent.com/palomachain/mainnet/master/tumbler/genesis.json
wget -O ~/.paloma/config/addrbook.json https://raw.githubusercontent.com/palomachain/mainnet/master/tumbler/addrbook.json

Next you can generate a new set of keys to the new machine, or reuse an existing key.

VALIDATOR=<choose a name>
palomad keys add "$VALIDATOR"

# Or if you have a mnemonic already, we can recover the keys with:
palomad keys add "$VALIDATOR" --recover

Head over to https://faucet.palomaswap.com/ and get some funds!

We can verify the new funds have been deposited.

palomad query bank balances --node tcp://testnet.palomaswap.com:26656 "$ADDRESS"

And start the node!

palomad start

If desired we can stake our funds and create a validator.

MONIKER="$(hostname)"
VALIDATOR="$(palomad keys list --list-names | head -n1)"
STAKE_AMOUNT=1000000ugrain
PUBKEY="$(palomad tendermint show-validator)"
palomad tx staking create-validator \
      --fees=1000000ugrain \
      --from="$VALIDATOR" \
      --amount="$STAKE_AMOUNT" \
      --pubkey="$PUBKEY" \
      --moniker="$MONIKER" \
      --website="https://www.example.com" \
      --details="<enter a description>" \
      --chain-id=$CHAIN_ID \
      --commission-rate="0.1" \
      --commission-max-rate="0.2" \
      --commission-max-change-rate="0.05" \
      --min-self-delegation="100" \
      --yes \
      --broadcast-mode=block

You may receive an error account sequence mismatch, you will need to wait until your local paloma catches up with the rest of the chain.

Running with systemd

First configure the service:

cat << EOT > /etc/systemd/system/palomad.service
[Unit]
Description=Paloma Blockchain
After=network.target
ConditionPathExists=/usr/local/bin/palomad

[Service]
Type=simple
LimitNOFILE=65535
Restart=always
RestartSec=5
WorkingDirectory=~
ExecStartPre=
ExecStart=/usr/local/bin/palomad start
Environment=PIGEON_HEALTHCHECK_PORT=5757
ExecReload=

[Install]
WantedBy=multi-user.target
EOT

Then reload systemd configurations and start the service!

service palomad start

# Check that it's running successfully:
service palomad status
# Or watch the logs:
journalctl -u palomad.service -f

Uploading a local contract

CONTRACT=<contract.wasm>
VALIDATOR="$(palomad keys list --list-names | head -n1)"
palomad tx wasm store "$CONTRACT" --from "$VALIDATOR" --broadcast-mode block -y --gas auto --fees 3000000000ugrain

paloma's People

Contributors

0xmuralik avatar aleem1314 avatar alessio avatar alexanderbez avatar alpe avatar brianosaurus avatar byte-bandit avatar deepan95dev avatar dependabot[bot] avatar jinjingroad avatar kj89 avatar maharifu avatar mahofmahof avatar markdaveny avatar measure-fi avatar mszuyev avatar omahs avatar overallteach avatar rootedbox avatar taariq avatar toasterthebrave avatar verabehr avatar vishal-kanna avatar vizualni avatar webelf101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paloma's Issues

Runner signing messages and sending signatures to the chain

Background

We need to build a tool in the runner to query messages that need to be signed by the runner itself so that consensus can be reached. We also need to submit those signatures back to the chain to store them.

Done when

  • we can query for messages from our chain that need to be signed from the runner
  • we can submit signatures for messages that we have queried from the runner

Define ValidatorSetUpdate message

Background

Define a message that’s used to update validator sets on our CosmWasm smart contract. The message needs to have a validator’s address and their staking power (in absolute terms).

Done when

  • Message is created as a protobuf message.

Message signing queue

Background

Once user submits a message for execution, we need to have a way for all validators to get new messages that need to get signed, and a way for them to submit their signatures.

The validators also need an endpoint to get messages which have reached a consensus and are ready for execution.

Done when

  • #50 and these tasks should be done together:
    • We have a query endpoint that can (given a validator’s address) return messages (emphasis on plurality) that need to be signed for the given validator.
    • We have a TX endpoint to which runners can submit signatures along with the messages that they have signed.
    • We have a query endpoint to query messages that have reached the consensus.
  • A way to add message to the signing queue (for internal usage)
  • A way to remove message from the signing queue (for internal usage)

Cross-chain communication through Runners

Background

We need to communicate with the Terra chain from within our runners which are a part of a FedEx chain (a sidecar process/goroutine).

We need to have a chain to query and broadcast transactions over the wire to other chain.

Given that there already exists a library that does this (LENS, by Strangelove) we don’t need to implement this ourselves.

Done when

  • we have imported lens library and verified that it works.

User interface Design

V1 Features

Ability to

  • Specify host chain
  • Specify target chain
  • Specify Target Contract
  • Specify Message Payload
  • Submit message

Message design for scheduled jobs

Background

We need to define a message which includes the smart contract address, payload and coins, along with the message’s unique ID. This message is to be used for the signing queue.

This differs from the “public” message where users define their jobs.

Done when

  • Message is defined in the protobuf

Conductor main loop and project structure organization

Background

Given that we are doing polling from the runner’s perspective, we need to have the (so called) main loop, in which we can query messages for signing & broadcasting. This is the beating heart of a runner.
We also need to organize code a bit better. So far, the code has been written mostly as something that we are using to test the idea.

Done when

  • When runner is started, the main loop is started as well.
  • project is organized a bit better

Signing messages from runners

Background

There are a couple of usecases we need to solve for message signing from the runners perspective:

  • Messages broadcasted to other chains (in this case Terra), need to be signed. We need a way to sign a CosmWasmExecute message from the runner’s perspective.
  • We also need to sign messages in the CosmWasmExecuteMsg format that we are signing to get 2/3 of signatures back.
  • And also, we need to sign the message to update the validator set to get a network concensus.

Done when

  • We can sign any arbitrary sdk.Msg and also verify signatures
  • We allow user to load keyring path in which they have their terra keys stored which is going to be used for message signing.

Sparrow configuration

Background

This is a top level ticket for runner configuration. Users should be able to customize their runners via configurations. Details should come in separate tickets.

Done when

  • there is a configuration for runners and runners are using the said configuration
  • the configuration is documented
  • we can't know all configuration required right now, but should build a way to have a support for it in the future

Query and broadcast transactions on chains using their GRPC server/clients

Background

Currently, we are using "raw" BroadcastTX when communicating with chains from the runner instance. We should take the GRPC server&client proto definition instead and communicate with the server like that. Same goes for running queries.

Done when

  • we can execute transactions on other chain from runner via their grpc server
  • we can query other chain from runner via their grpc server

Setup the github actions for running tests

Background

As testing is really important, we don't want to submit any PR that breaks tests. We also don't want to merge broken PRs.

Done when

  • we have a basic go test running on every branch
  • disallow merging PRs without the test action passing

As creators of the chain, we want to have the right slashing parameters in place so that malicious behavior on the validator side is prevented, while risk for them is low enough to they remain engaged and are motivated to stake.

As Volume, we want to have the right slashing parameters in place so that malicious behavior on the validator side is prevented, while risk for them is low enough to they remain engaged and are motivated to stake.

Acceptance Criteria

Slashing amounts / parameters / punishments

  • 5% for signing a fake validator set or message, double sign, etc.
    • Will only be slashed once, then the validator should be jailed
  • 5% for failure to sign a message or validator set
    • Will only be slashed once, then the validator should be jailed

  • 1% for a downtime of 10k blocks (~13h)
    • → Jailing is very important in this case (as it preserves network uptime)
  • Jailing

Password input for runner's keyrings

Background

When creating a new ChainClient using lens library, the keyring in background expects user to enter password.
This is all fine but this cannot work for our usecase because runners will be executed as a long running process
which should be able to restart itself if there ever is a failure. That would mean that validator/user would need to manually
enter their password every time.

Mind the "userInput" argument: https://github.com/cosmos/cosmos-sdk/blob/df8745909c9d973d3ddad7400140ec42ca17a316/crypto/keyring/keyring.go#L172
This asks user for password via stdin, and then stores the password in memory.

A proposal is to inject the password via ENV variable and store it in memory instead of user having to enter their password every time.

Done when

  • user doesn't have to enter their password via stdin for runner to get access to keyring

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.