Giter Club home page Giter Club logo

go-libs's People

Contributors

anonyma avatar carlcarl avatar covain avatar defisaur avatar deimondb avatar dependabot[bot] avatar dimkouv avatar enorage avatar hewigovens avatar icell avatar liam-trust avatar madcake avatar nikoskarakostas avatar qct avatar tw-dmy avatar unanoc avatar vikmeup avatar vminkobin avatar vorotech 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-libs's Issues

Review current rabbitmq producer health check

Existing mq health check can be improved, so it checks more then connection state.

Possible approach:

func checkChannelHealth(channel *amqp.Channel) {
	_, err := channel.ExchangeDeclarePassive(
		"healthcheck", // name
		"direct",      // type
		true,          // durable
		false,         // auto-deleted
		false,         // internal
		false,         // no-wait
		nil,           // arguments
	)
	if err != nil {
		fmt.Println("Channel is not healthy:", err)
	} else {
		fmt.Println("Channel is healthy")
	}
}

[MQ] Add reconnection logic for producer

For mq producer implement next logic:

  1. publish attempt returns error.
  2. check if the error is connection-related.
  3. try to reconnect for 5 times with increasing of the timeout

Transactions Format V2

Types to support:

  • Coin transfers
  • Token transfers
  • Swaps (from to asset)
  • Staking (delegations / undelegations), claim rewards, vote ... redelegating
  • Smart contract calls (deposit, claim) - function name + values, raw data
  • Pre build actions. Approve asset 1.
  • Collectibles Transfers
  • Governance Vote #1 Yes/No.
  • DEX (New, Cancel, Execute, Fill)

Small use cases:

  • Lending (Borrow n AAVE, Lend 20 COMP, MINT 102 SPX)
  • Provide liquidity pool ETH<>DAI
  • Deposit funds to L2 network (could live in smart contract)

Discussion points

  • How to support any action format?
  • How to localize?
  • How to add new events and stay compatible?

Additional support for:

  • transactions types
  • offset and limit - (pagination)
  • timestamp
  • versioning

/transactions?types=transfer|token_transfer&from_timestamp=123&version=3&page=1&limit=10

Old Coin Transfer:

{
   "id":"0x05a9c7b75f57d7489dc143eb51600315439a324cdc2f749a27b99d7d395a7fe5",
   "coin":10000714,
   "from":"0x4982085C9e2F89F2eCb8131Eca71aFAD896e89CB",
   "to":"0x377E196Acd9215A881fc101A64AAa6CA0b0a75D6",
   "fee":"441000000000000",
   "date":1611012545,
   "block":4110960,
   "status":"completed",
   "sequence":12604,
   "type":"transfer",
   "direction":"outgoing",
   "memo":"",
   "metadata":{
      "value":"2000000000000000",
      "symbol":"BNB",
      "decimals":18
   }
}

New Coin Transfer Format:

{
   "id":"0x05a9c7b75f57d7489dc143eb51600315439a324cdc2f749a27b99d7d395a7fe5",
   "asset_id":"c714",
   "from":"0x4982085C9e2F89F2eCb8131Eca71aFAD896e89CB",
   "to":"0x377E196Acd9215A881fc101A64AAa6CA0b0a75D6",
   "fee": {
        "asset": "c714_cTWT",
        "value": "441000000000000"
    },
   "date":1611012545,
   "block":4110960,
   "status":"completed",
   "sequence":12604,
   "direction":"outgoing",
   "memo":"",
}
   "transfers": [{
       "from":"0x4982085C9e2F89F2eCb8131Eca71aFAD896e89CB",
       "to":"0x377E196Acd9215A881fc101A64AAa6CA0b0a75D6",
       "asset": "c714",
       "value":"2000000000000000",
   }]
  "swaps": [{
          "from": {
              "address": "0x4982085C9e2F89F2eCb8131Eca71aFAD896e89CB"
               "asset": "c714"
              "value":"2000000000000000",
          },
          "to": {
               "address": "0x377E196Acd9215A881fc101A64AAa6CA0b0a75D6"
               "asset": "c714"
              "value":"2000000000000000",
          }
   }],
   "smart_contract_call": {

   }

status: pending, completed, error

Place all clients urls in config file

There are a lot of lines with hardcoded URLs like

func (c Client) FetchMarketPairs(limit int) (pairs []MarketPair, err error) {
params := url.Values{"limit": {strconv.Itoa(limit)}}
err = c.req.Get(&pairs, "/api/v1/markets", params)
return pairs, err
}

What if we move it out from these methods and place in config file, so it would be easier to track and change it in future

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.