Skip to content

Instantly share code, notes, and snippets.

@brossi
Last active February 10, 2023 00:08
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 29 You must be signed in to fork a gist
  • Save brossi/175f60bd1dc4f99f9373 to your computer and use it in GitHub Desktop.
Save brossi/175f60bd1dc4f99f9373 to your computer and use it in GitHub Desktop.
Adding A New Cryptocurrency to Peatio

State: Draft
Based on the Peatio Stable branch


Coin Daemon

To the coin daemon's {coin}.conf file, include the -walletnotify command:

# Notify when receiving coins
walletnotify=/usr/local/sbin/rabbitmqadmin publish routing_key=peatio.deposit.coin payload='{"txid":"%s", "channel_key":"COIN_NAME_SINGULAR"}'

Peatio

Peatio files that need to be updated when a new coin is added:

peatio/current/config/

  • currencies.yml
  • deposit_channels.yml
  • markets.yml
  • withdraw_channels.yml

peatio/current/app/controllers/

  • admin/deposits/{coin}s_controller.rb
  • admin/withdraws/{coin}s_controller.rb
  • private/assets_controller.rb // add into def index
  • private/deposits/{coin}s_controller.rb
  • private/withdraws/{coin}s_controller.rb

peatio/current/app/models/

  • admin/ability.rb // add to def initialize(user)
  • deposits/{coin}.rb
  • withdraws/{coin}.rb

peatio/current/app/views/

  • admin/deposits/{coin}s/index.html.slim
  • admin/withdraws/{coin}s/_table.html.slim
  • admin/withdraws/{coin}s/index.html.slim
  • admin/withdraws/{coin}s/show.html.slim
  • private/assets/_{cur_code}_assets.html.slim
  • app/views/private/assets/_liability_tabs.html.slim // add to .ul.nav.nav-tabs and .tab-content
  • app/views/private/assets/index.html.slim // add to ul.nav.nav-justified.asssets-nav and content_for
  • private/deposits/{coin}s/new.html.slim
  • private/withdraws/{coin}s/new.html.slim // include edit.html.slim in the directory, but no changes needed to that file

peatio/current/config/locales/

  • en.yml
  • breadcrumbs/en.yml (// add titles for new routes)
  • currency/en.yml (// add new currency titles to the existing list of supported currencies)
  • deposits/{coin}s/en.yml
  • enumerize/en.yml
  • private/assets/en.yml
  • private/funds/en.yml
  • private/shared/en.yml
  • withdraws/{coin}s/en.yml

Other

If you are changing base currency from CNY to another base fiat currency (e.g. USD):

  • app/controllers/admin/currency_deposits_controller.rb
  • config/locales/banks/en.yml

If you are adding a Peercoin-derived currency, you will need to update peatio/current/app/models/worker/deposit_coin.rb (Source)

@janx
Copy link

janx commented Oct 25, 2014

To be precisely, markets.yml is not required for a new currency, but a new market (currency pair), although these two usually comes together 😄

@summm
Copy link

summm commented Oct 31, 2014

there is so much changed after you write this.
i try to modify all files of the list and reboot pc.
it's no works,and don't know where is the problem.
i will try it agin .

@summm
Copy link

summm commented Nov 2, 2014

config/withdraw_channels.yml

- id: 200
  key: satoshi
  currency: btc
  fixed: 8
  fee: 0.0005
  inuse: true
  type: WithdrawChannelSatoshi
- id: 400
  key: bank
  currency: cny
  fixed: 2
  fee_max: 0
  min: 100
  max: 50000
  fee: 0.003
  proportion: true
  inuse: true
  type: WithdrawChannelBank
- id: 600
  key: litecoin
  currency: ltc
  fixed: 8
  fee: 0.0005
  inuse: true
  type: WithdrawChannelLitecoin

add this
admin panel can't entre

@vetal20600
Copy link

Is there any additional advices? I followed your instructions. It seems working except withdrawal.
By the way there are no few files you mentioned above ("app/controllers/admin/currency_deposits_controller.rb" and almost each yml file) in current peatio sources.

@NeerajThapliyal
Copy link

NeerajThapliyal commented Jun 12, 2017

what code should be enter in these file?
please help me..

@ShadowMyst
Copy link

Puedes ser mas especifico con las formas de agregar mas divisas Fiat

You can be more specific with ways to add more Fiat currency

@ShadowMyst
Copy link

Anyway this document is very important, I will put it in my fork of Peatio (https://github.com/ShadowMyst/peatio), for which I want to support also, and I will also seek to do documentation in Spanish.

@muhammednagy
Copy link

@ShadowMyst
don't these aren't complete
i tried them

@ShadowMyst
Copy link

@muhammednagy
Then which ones are complete?

@muhammednagy
Copy link

@ShadowMyst
actually, there is no complete documentation about adding a new coin
plus adding a new coin that isn't Bitcoin compatible like ethereum is so hard

@legends420
Copy link

got the coin added but cant seem to connect to the daemon just shows n/a for balance

@streamcoindev
Copy link

is there any documentation n adding coins with scrypt alghoritm like litecoin ?

@legends420
Copy link

legends420 commented Nov 11, 2017

got 2 masternode coins working deposits and withdrawl as well as trading

@streamcoindev
Copy link

@legends420 how ? i tried to add a new coin but when i go to the funds page and click on withdraw or deposit i get a blank white page instead of where te wallet address should be can you help ?

@istiaqiut
Copy link

Hi,
Do I need to add walletnotify=/usr/local/sbin/rabbitmqadmin publish routing_key=peatio.deposit.coin payload='{"txid":"%s", "channel_key":"COIN_NAME_SINGULAR"}'
command again for new coin?

@ian2179
Copy link

ian2179 commented Apr 23, 2018

how to add new coin currencies into the exchange, im stuck for this.

@RahulBhut21
Copy link

when add BTC coin can not fetch current bitcoin market data in trading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment